<?php 
global $_W,$_GPC;

$taskid = intval($_GPC['taskid']);
$reciveid = intval($_GPC['reciveid']);
if(!empty($taskid)){
	$sql = "SELECT * FROM ".tablename('imeepos_runner3_recive')." WHERE uniacid = :uniacid AND taskid = :taskid";
	$params = array(':uniacid'=>$_W['uniacid'],':taskid'=>$taskid);
	$recive = pdo_fetch($sql,$params);
	
	$sql = "SELECT * FROM ".tablename('imeepos_runner3_member')." WHERE uniacid = :uniacid AND openid = :openid";
	$params = array(':uniacid'=>$_W['uniacid'],':openid'=>$recive['openid']);
	$reciver = pdo_fetch($sql,$params);
	
	$sql = "SELECT * FROM ".tablename('imeepos_runner3_tasks')." WHERE id = :id";
	$params = array(':id'=>$recive['taskid']);
	$task = pdo_fetch($sql,$params);
	
	
	$sql = "SELECT * FROM ".tablename('imeepos_runner3_member')." WHERE uniacid = :uniacid AND openid = :openid";
	$params = array(':uniacid'=>$_W['uniacid'],':openid'=>$task['openid']);
	$user = pdo_fetch($sql,$params);
}

if(!empty($reciveid)){
	$sql = "SELECT * FROM ".tablename('imeepos_runner3_recive')." WHERE uniacid = :uniacid AND id = :id";
	$params = array(':uniacid'=>$_W['uniacid'],':id'=>$reciveid);
	$recive = pdo_fetch($sql,$params);
	
	$sql = "SELECT * FROM ".tablename('imeepos_runner3_member')." WHERE uniacid = :uniacid AND openid = :openid";
	$params = array(':uniacid'=>$_W['uniacid'],':openid'=>$recive['openid']);
	$reciver = pdo_fetch($sql,$params);
	
	$sql = "SELECT * FROM ".tablename('imeepos_runner3_tasks')." WHERE id = :id";
	$params = array(':id'=>$recive['taskid']);
	$task = pdo_fetch($sql,$params);
	
	
	$sql = "SELECT * FROM ".tablename('imeepos_runner3_member')." WHERE uniacid = :uniacid AND openid = :openid";
	$params = array(':uniacid'=>$_W['uniacid'],':openid'=>$task['openid']);
	$user = pdo_fetch($sql,$params);
}

include $this->template('web/task/task_detail');